#! /usr/bin/perl -w
use strict;
sub output {
    print @_ or die "$0: stdout: $!\n";
}
my @csv = `../config.status --version`;
my $version;
my $options;
my $cc;
my $compiler;
for(@csv) {
    chomp;
    if(/disorder config\.status (\S+)/) {
	$version = $1;
    }
    if(/with options \"(.*)\"/) {
	$options = $1;
    }
}
if(exists $ENV{CC}) {
    $cc = $ENV{CC};
    $cc =~ s/\s+/ /g;
    my @cv = `$cc --version`;
    $compiler = $cv[0];
}
die "no version found\n" unless defined $version;
output("%s (DisOrder) $version\n");
output("Copyright (C) 2003-2011 Richard Kettlewell et al\n");
output("License GPLv3+: GNU GPL version 3 or later:\n");
output("        http://www.gnu.org/licenses/gpl-3.0.html\n");
output("This is free software: you are free to change and redistribute it.\n");
output("There is NO WARRANTY, to the extent permitted by law.\n");
output("WARNING: -Werror not used in this build\n") if $cc !~ /-Werror/;

close STDOUT or die "$0: stdout: $!\n";
